﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucSanPhamVuaXem.ascx.cs"
    Inherits="UserControl_Nice_ucSanPhamVuaXem" %>
<asp:DataList ID="DataList1" runat="server" DataKeyField="MaSanPham" DataSourceID="SqlDataSource1">
    <ItemTemplate>
        <a href='ProductDetail.aspx?id_product=<%# Eval("MaSanPham") %>'>
            <asp:Image Width="180px" Height="198px" ID="Image15" runat="server" ImageUrl='<%# Eval("HinhAnh") %>' />
        </a>
        <div class="productname">
            Tên SP:
            <asp:Label ID="Label1" runat="server" Text='<%# Eval("MaSanPham") %>'></asp:Label></div>
        <div class="productprice">
            Giá:
            <asp:Label ID="Label2" runat="server" Text='<%# Eval("GiaBan", "{0:N0} VNĐ") %>'></asp:Label></div>
        <br />
    </ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
    
    SelectCommand="SELECT *,(select top 1 url from hinhanh where hinhanh.masanpham=sanpham.masanpham) as hinhanh FROM [SanPham] WHERE masanpham=@masanpham">
    <SelectParameters>
        <asp:SessionParameter Name="masanpham" SessionField="view1" />
    </SelectParameters>
</asp:SqlDataSource>
<asp:DataList ID="DataList2" runat="server" DataKeyField="MaSanPham" 
    DataSourceID="SqlDataSource2">
    <ItemTemplate>
        <a href='ProductDetail.aspx?id_product=<%# Eval("MaSanPham") %>'>
            <asp:Image Width="180px" Height="198px" ID="Image15" runat="server" ImageUrl='<%# Eval("HinhAnh") %>' />
        </a>
        <div class="productname">
            Tên SP:
            <asp:Label ID="Label1" runat="server" Text='<%# Eval("MaSanPham") %>'></asp:Label></div>
        <div class="productprice">
            Giá:
            <asp:Label ID="Label2" runat="server" Text='<%# Eval("GiaBan", "{0:N0} VNĐ") %>'></asp:Label></div>
        <br />
    </ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
    
    SelectCommand="SELECT *,(select top 1 url from hinhanh where hinhanh.masanpham=sanpham.masanpham) as hinhanh FROM [SanPham] WHERE masanpham=@masanpham">
    <SelectParameters>
        <asp:SessionParameter Name="masanpham" SessionField="view2" />
    </SelectParameters>
</asp:SqlDataSource>
